#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <bitset>
#include <utility>
using namespace std;

#define mm(a, n) memset(a, n, sizeof a)
#define mk(a, b) make_pair(a, b)

const double eps = 1e-6;
const int INF = 0x3f3f3f3f;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<LL, LL> PLL;
typedef pair<int, LL> PIL;

inline void quickread()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

const int MAXN = 1e7 + 10;
set<int> st;

LL prime[MAXN], primesize;
bool isprime[MAXN];
void init()
{
    memset(isprime, 1, sizeof(isprime));
    isprime[1] = false;
    for (int i = 2; i <= MAXN; i++)
    {
        if (isprime[i])
            prime[++primesize] = i;
        for (int j = 1; j <= primesize && i * prime[j] <= MAXN; j++)
        {
            isprime[i * prime[j]] = false;
            if (i % prime[j] == 0)
                break;
        }
    }
}

inline void solution()
{
    LL a, b, m = 0;
    cin >> a;
    if (a == 0)
    {
        printf("1\n");
        printf("0 = 0\n");
        return;
    }

    if (a == 1)
    {
        printf("1\n");
        printf("1 = 1\n");
        return;
    }
    if (a == 2)
    {
        printf("1\n");
        printf("2 = 2\n");
        return;
    }
    b = a;
    if (a % 2 == 1)
    {
        if (isprime[a])
        {
            printf("1\n");
            printf("%lld = %lld\n", a, a);
            return;
        }
        if (isprime[a - 2])
        {
            printf("2\n");
            printf("2 + %lld = %lld\n", a - 2, a);
            return;
        }
        else
        {
            m++;
            b = a - 1;
        }
    }
    for (LL i = 0;; i++)
    {
        if (isprime[b - prime[i]])
        {
            m += 2;
            printf("%lld\n", m);
            if (a % 2 == 1)
            {
                m += 1;
                printf("1 + ");
            }
            printf("%lld + %lld = %lld\n", prime[i], b - prime[i], a);
            break;
        }
    }
}

int main()
{
    init();
    freopen("input.txt", "r", stdin);
    quickread();
    int T;
    cin >> T;
    while (T--)
    {
        solution();
    }
    return 0;
}